<style type="text/css">
	.err{
		font-family:Tahoma;
		font-size:12px;
		color:#FF0000;
		font-weight:600;
	}
</style>

<script language="javascript">
function btnSend_onclick(){
	if(test_empty(document.frmContact.txtName.value)){
		alert(mustInput_Name);document.frmContact.txtName.focus();return false;
	}
	if(test_empty(document.frmContact.txtEmail.value)){
		alert(mustInput_Email);document.frmContact.txtEmail.focus();return false;
	}
	if(test_empty(document.frmContact.txtDetail.innerText)){
		alert(mustInput_Detail);document.frmContact.txtDetail.focus();return false;
	}
	return true;
}

</script>

<? $errMsg =''?>

<?
$l_hoten    = $_lang == 'vn' ? 'Full name' : 'Full name';
$l_email    = $_lang == 'vn' ? 'E-mail' : 'E-mail';
$l_dt       = $_lang == 'vn' ? 'Telephone Number' : 'Telephone Number';
$l_noidung  = $_lang == 'vn' ? 'Content' : 'Content';
$l_nutgoi   = $_lang == 'vn' ? 'Send' : 'Send';
$l_nutxoa   = $_lang == 'vn' ? 'Reset' : 'Reset';

if (isset($_POST['btnSend'])){

	$name      = trim($_POST['txtName']);
	$email     = trim($_POST['txtEmail']);
	$tel       = trim($_POST['txtTel']);
	$detail    = trim($_POST['txtDetail']);
	
	$body  = "Full name     : ".$name."<br>\n";
	$body .= "Email      : ".$email."<br>\n";
	$body .= "Telephone Number : ".$tel."<br>\n";
	$body .= "Content   : ".$detail."<br>\n";

	if (send_mail($email,$adminEmail,"Contact from : ".$name, $body))

		echo "<script>window.location='./?frame=contact&code=1'</script>";

	else

		$errMsg = $_lang == 'vn' ? "Can not send contact infomation !<br>Please contact to administrator to be guided." : "Can not send contact infomation !<br>Please contact to administrator to be guided.";

}

if ($_REQUEST['code']==1)

	$errMsg = $_lang == 'vn' ? "We will usually respond within 24 hours to your email!. Or you may call to leave a message and a UK Sales Agent will return your call.." : "Your e-mail have been send to us. We will reply within 24 hours. Many thanks."?>

<form method="POST" name="frmContact" action="./">
<input type="hidden" name="frame" value="contact">

<table align="center" width="95%" cellpadding="0" cellspacing="0">
	<tr>
		<td>
			<h2 style="color:#FF0000;"><img src="img/list.png"> Contact Us<br /><br /></h2>
		
			<span>			
				<p>As we are strictly an internet based company we do not have an actual walk in office and reception area to welcome you in. You may contact us on the following emails in confidence your information is not passed on<br /><br /></p>

				<h2>BonerBarn Contact Form</h2><br /><br />
				
				<p>Questions marked by <font color="#ff0000"> * </font> are required. </p><br />
		</td>
	</tr>

	<tr><td align="center" style="padding-right:80px"><? if($errMsg!=''){echo '<p align=center class="err">'.$errMsg.'<br></p>';}?></td></tr>	
	<tr><td height="10px"></td></tr>
	<tr>
		<td>

<table border="0" width="100%" cellspacing="1" cellpadding="0" style="border-collapse:collapse" >

	<tr>

		<td width="30%" align="right" class="normalFont"><font color="#FF0000">*</font> <?=$l_hoten?> : </td>

		<td>&nbsp;<input class="textbox" size=30 name="txtName" value="<?=$name?>"></td>

	</tr>
	<tr>
		<td align="right" class="normalFont"><font color="#FF0000">*</font> <?=$l_email?> : </td>
		<td>&nbsp;<input class="textbox" size=30 name="txtEmail" value="<?=$email?>"></td>
	</tr>
	<tr>
		<td align="right" class="normalFont"><font color="#FF0000">*</font><?=$l_dt?> : </td>
		<td>&nbsp;<input class="textbox" size=30 name="txtTel" value="<?=$tel?>"></td>
	</tr>
	<tr>
	   <td align="right" class="normalFont"><font color="#FF0000">*</font> <?=$l_noidung?> &nbsp;</td>
		<td>&nbsp;<textarea class="textbox" name="txtDetail" rows="7" cols="25"></textarea></td>
	</tr>
</table>		
		</td>
	</tr>
	<tr><td height="10px"></td></tr>
	<tr>
		<td align="center">

			&nbsp;<input class="buttonOrange" onmouseover="this.className='buttonBlue'" onmouseout="this.className='buttonOrange'" type="submit" value="<?=$l_nutgoi?>" name="btnSend" style="height: 22px; width:100px" onclick="return btnSend_onclick()">

			&nbsp;<input class="buttonOrange" onmouseover="this.className='buttonBlue'" onmouseout="this.className='buttonOrange'" type="reset" value="<?=$l_nutxoa?>" name="btnReset" style="height: 22px; width:80px">

		</td>

	</tr>
	<tr>
		<td>
						
				<p><a href="#">sales@sleep-express.in</a></p>
				
				<p>We will usually respond within 24 hours to your email <br /><br /></p>
										
				<p>IOr you may call to leave a message and a UK Sales Agent will return your call.<br /><br /></p>
				
			</span>		
		</td>
	</tr>
</table>
</form>

